package com.stackexchange.webapis
{
	public class Question
	{
		/**
		 * 
		 */ 
		public var answerCount:int;
		
		private var _tags:Array  /* of Tag */ = new Array();
		private var _answers:Array  /* of Answer */ = new Array();
		private var _comments:Array  /* of Comment */ = new Array();

		/**
		 * id of the accepted answer
		 */
		public var acceptedAnswerId:int;
		
		/**
		 * number of users who have favorited this question
		 */
		public var favoriteCount:int;
		
		/**
		 * date the bounty closes on this question
		 */
		public var bountyClosesDate:Date;
		
		/**
		 * amount of rep the bounty is worth
		 */
		public var bountyAmount:int;
		
		/**
		 * date this question was closed
		 */
		public var closedDate:Date;
		
		/**
		 * why this question was closed
		 */
		public var closedReason:String;
		
		/**
		 * date this question was protected
		 */
		public var protectedDate:Date;
		
		/**
		 * id of the question this one was migrated to
		 */
		public var migrated:Migration;
		
		/**
		 * link to the timeline of this question
		 */
		public var questionTimelineUrl:String;
		
		/**
		 * link to the comments on this question
		 */
		public var questionCommentsUrl:String;
		
		/**
		 * link to the answers on this question
		 */
		public var questionAnswersUrl:String;
		
		/**
		 * id of the question this post is or is on
		 */
		public var questionId:int;
		
		/**
		 * date this question was locked
		 */
		public var lockedDate:Date;
		
		/**
		 * question owner
		 */
		public var owner:User;
		
		/**
		 * date this post was created
		 */
		public var creationDate:Date;
		
		/**
		 * last time this post was edited
		 */
		public var lastEditDate:Date;
		
		/**
		 * last time this post had any activity
		 */
		public var lastActivityDate:Date;
		
		/**
		 * number of up votes on this post
		 */
		public var upVoteCount:int;
		
		/**
		 * number of down votes on this post
		 */
		public var downVoteCount:int;
		
		/**
		 * number of times this post has been viewed
		 */
		public var viewCount:int;
		
		/**
		 * score of this post
		 */
		public var score:int;
		
		/**
		 * whether this post is community owned
		 */
		public var communityOwned:Boolean;
		
		/**
		 * title of this post, in plaintext
		 */
		public var title:String;
		
		/**
		 * body of this post, rendered as HTML
		 */
		public var body:String;
		
		public function addAnswer(value:Answer):void
		{
			_answers.push(value);
		}
		
		/**
		 * Question answers 
		 **/
		public function get answers():Array
		{
			return _answers.slice();
		}
		
		public function addTag(value:Tag):void
		{
			_tags.push(value);
		}
		
		/**
		 * Question tags 
		 **/
		public function get tags():Array
		{
			return _tags.slice();
		}
		
		public function addComment(value:Comment):void
		{
			_comments.push(value);
		}
		
		/**
		 * Question comments 
		 **/
		public function get comments():Array
		{
			return _comments.slice();
		}
	}
}